mytimeatportiafandomcom-20200222-history
User blog:Skuldomg88/Documenting the game tables
Introduction All game data is stored in the Program Directory\Portia_Data\StreamingAssets\CccData\LocalDb.bytes table. By copying it to another directory and renaming the extension to .db it can be treated as a regular SQL table and read with, for example, DB Browser for SQLite. In this blog I will do my best to document what the tables contain. For now it is mainly for myself but maybe other people can get something out of this too. Note that these tables only contain textual game data, NOT actual textures, sounds or anything to that regard. To extract textures or sounds, you will need a program like Unity Bundle Extractor. Tables interesting for modding Here I will list tables that are immediately relevant for modding major game aspects. Always backup your original game files and modify any tables at your own risk. Translation_hint Arguably the most important table when it comes to decoding other tables. Here all the game's text is stored in English, Chinese, German and French. Each text line has their own unique ID. By cross-referencing these with other tables you can find out exactly what is being referenced. ID: The text ID. English: English text Chinese: Chinese text VoiceID German: German text French: French text Props_total_table Contains all items in the game, along with interesting fields like Buy/Sell price etc. Also contains the Props_Id which other tables use. In combination with the Translation_hint table, we can figure out what item is being referenced in other tables. Props_Id: Unique item ID Props_Name: Text ID of the item name (lookup via Translation_hint ... NpcRepository Contains all NPCs in the game, along with interesting fields like Gift list, Height, Weight, etc. Id Name: Text ID of the NPC name (lookup via Translation_hint ... Synthesis_table Contains crafting recipes. Synthesis_Id Name: Text ID of the crafted item's name Item_Id: ID of the crafted item (lookup via Props_total_table, Props_Id) Furniture_Id Item_Label Data_one_id: ID of the first ingredient (lookup via Props_total_table, Props_Id) Data_one_number: How many of the first ingredient is needed? (ie. need 1 Wheat to craft 1 Flour) Data_two_id: ID of the second ingredient Data_two_number: How many of the second ingredient is needed? Data_three_id: ID of the third ingredient Data_three_number: How many of the third ingredient is needed? Game_level Product_list Exp: Experience earned for crafting this item (always 10) ... Minor Tables I will just go through them in alphabetical order and list all their columns with a description if I have any. Ability_Tree Branch: 0-2. Seems to indicate what skill tree the ability belongs to Class: 0-4 Number: 1-5 Upper_Limit: 1-5 Icon: Filepath to the ability's icon Name: ID of the ability name text Description: ID of the ability description text Para_List: Name of the parameter list, for example HpMax_0.05 Achievement id: ID starting from 1001 platformTag: Contains short names for the achievement, for example M_FIRST_DAY or M_ACK sid: Another ID starting from 1 type: Categorization, contains entries such as FinishTask or KickTreeTimes. Formulates the achievement requisite together with the following columns. checkType: Condition, together with the previous and next values it formulates the achievement prerequisite. An entry reads for example NumberEquals or NumberGreater. mainPara: Main parameter for the achievement prerequisite. subPara: Sub parameter for the achievement prerequisite. For the achievement for picking up Animal Feces for example, these columns will read: PickItemTimes - Number Greater - 499 - 4000135, meaning the player will have to pick the item with the ID 4000135 up more than 499 times in order to trigger the achievement. name: ID of the achievement's name text description: ID of the achievement's description text iconPath: All entries are 0. isSecret: Is the achievement a hidden achievement or not? (0/1 values) isFunctional: All entries are 0. ActionInterrupt Seems to define what actions can be interrupted by other actions. Id Name: Contains the action's name, ie. Idle or Jump Interrupt: ID of the actions that interrupts this action (?) Parallel: ID of the actions that can run parallel to this action (?) Others This section contains tables which I don't believe are important/relevant. _InteractItem_old_20180531: This table is empty AccMission_Dialog: Only contains one entry, not sure if this is even used Ability_Tree_New: Same as Ability_Tree but with an additional ID column. Also contains the same exact entries. How to mod Now how do we actually mod something? If you took a look at the table section above, you will already have noticed that some aspects are easily modified while others are more obscure. Let's start with something relatively easy - let's say we want to modify a crafting recipe. Modding crafting recipes When I'm actually playing the game and not digging through it's core, I like to plant. What bothers me is that using fertilizer is actually a losing business - if I buy all my fertilizer supplies I lose money because it is so expensive that the plants I sell break me even. And the game's original crafting recipe (2 Animal Bones, 1 Mucus, 2 Animal Feces) is no good for mass producing fertilizer either since Mucus is relatively hard to come by. So let's change the recipe to something more realistic and feasible: 2 Soil and 1 Animal Feces. First we need to find the Crafting Recipe for Fertilizer, so we look at the Synthesis_table. Here we can find the Name column. This one tells us the text ID of the item's name. That is coded in our Translation_hint table. So now we work our way backwards. 1. Search for Fertilizer in Translation_hint. The first result (Apply Fertilizer) is not interesting for us, since that seems to be text used elsewhere. The second result is our suspect - we find that the text Fertilizer has the ID 270210. 2. Back to the Synthesis_table. Search for the ID we just found in the Name column. Here we find the recipe for Fertilizer. We discover the IDs of the used items. If we wanted to, we could verify that we have the right suspect by looking them up in the Props_total_table and check their Props_Id and Props_Name. 3. Now that we have found our crafting recipe, we need to find out the IDs for our new ingredients. We do that by finding them in the Props_total_table. You know how the drill works by now. We find out that Soil has the ID 4000008 and Animal Feces 4000135. The hard part is over! Now we just change Data_one_id to 4000008 (Soil), Data_one_number to 2''', and '''Data_two_id to 4000135 (Animal Feces) and Data_two_number to 1'''. We delete the values for '''Data_three_id and Data_three_number. Now save the database, rename it back from LocalDb.db to LocalDb.bytes and replace it in the game's folder. After loading the game back up and excitedly running to our Blender, we find: Success! Category:Blog posts